import java.util.ArrayList;
import java.util.List;

/**
 * Created by ChangJiabo
 * on 19-9-4 下午3:37.
 */
public class Palindrome {

    public static boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        List<Integer> dividInt = new ArrayList();
        while (x > 0) {
            dividInt.add(x % 10);
            x /= 10;
        }
        for (int i = 0; i < dividInt.size() / 2; i++) {
            if (!dividInt.get(i).equals(dividInt.get(dividInt.size() - i - 1))){
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        System.out.println(isPalindrome(-521));
    }
}
